@use "sass:map";

// {bem_b,bem_e,bem_m,VueAndNvueStyleAttr,when}
@use "./mixin/mixins.scss" as *;
@use './mixin/function.scss' as *;
// // {set-component-css-var}
@use "./mixin/_var.scss" as *;
// // {$badge}
@use "./common/var.scss" as *;

@import "common/index.scss";

$e-badge-text-align: center !default;

@include bem_b(badge) {
  // 设置input的css变量
  // @include set-component-css-var("badge", $badge);
  position: relative;
  /* #ifndef APP-NVUE */
  display: inline-block;
  vertical-align: middle;
  /* #endif */
 
  

  @include bem_e(content) {
    @include flex;
    @include VueAndNvueStyleAttr("border-radius","badge", "radius");
    @include VueAndNvueStyleAttr("padding","badge", "padding");	
	/* #ifndef APP-NVUE */
	word-break:normal;
	/* #endif */
    &__text {
      text-align: $e-badge-text-align;
      @include VueAndNvueStyleAttr("font-size","badge", "font-size");
	  @include VueAndNvueStyleAttr("line-height","badge", "font-size");
      @include VueAndNvueStyleAttr("color","badge", "color");
    }
    @include when(dot) {
      @include VueAndNvueStyleAttr("height","badge", "dot-size");
      @include VueAndNvueStyleAttr("width","badge", "dot-size");
      padding: 0;
    }
    @include when(horn) {
      border-bottom-left-radius: 0;
    }
  }
  // 批量设置按钮的css变量
  @each $type in (primary, success, warning, error, info) {
    @include bem_m($type) {
		@include VueAndNvueStyleAttr("background-color","badge", "#{$type}-background-color",);
      @include bem_m(inverted) {
        font-size: 13px;
        @include VueAndNvueStyleAttr("color","color", $type);
      }
    }
  }
}
